正在查看 2 结果:1-2 (共 2 个结果)
-
搜索结果
-
直接贴代码上来吧,暂时我们还没启用,但后面如果被垃圾注册用户和注册机给弄烦了还是会开启的,下面的代码修改
@company1.com
@company2.com
@company3.com
的后缀为你想要用户使用的,比如 163、QQ、gmail 等等。代码放到子主题的功能文件 PHP 里。
add_action('um_before_new_user_register', 'require_google_email_for_signup'); function require_google_email_for_signup( $args ) { extract($args); // Store allowed domains in an array $allowed_domains = ['@company1.com', '@company2.com', '@company3.com']; // Set flag to false (fail-safe) $check = false; // Iterate through all allowed domains foreach( $allowed_domains as $domain ) { // If a match is found (remember to use lowercase emails!) // Update flag and break out of for loop if ( strpos( strtolower( $user_email ), $domain ) !== false ) { $check = true; break; } } if ( !$check ) exit( wp_redirect( add_query_arg('err', 'you_must_have_googlemail') ) ); }
效果的话没测试,但后台插件自带的那个屏蔽邮件黑名单不起作用,也没辙,这个算是加个白名单功能。
话题: 如何设置好 url 结构?
我在后台设置好“固定链接”,/%category%/%post_id%/
但是网址看起来也有些凌乱,需要使用什么插件,怎么设置,或者什么代码来调整吗?
(网址:https://127.0.0.1/wordpress_demo)
现在的url如下(如果有多个子类,会连子类全部别名会显示在链接url上,造成url太长):
https://127.0.0.1/wordpress_demo/product-category/hexinyewu/zhuangbeizhizao/ (某个分类产品列表页)
https://127.0.0.1/wordpress_demo/xinwenzhongxin/company-news/82/ (某个新闻分类的新闻详细页)
想要设置的url如下:
(分类+数字.html)
例如:
https://www.vmall.com/product/936223974.html
正在查看 2 结果:1-2 (共 2 个结果)
未找到对应子版块?请直接在 [疑难杂症] 版块中发帖提问。